package com.untilov.gb.model;

/**
 * Represent one rss feed.
 * 
 * @author iuntilov
 * 
 */
public class FeedItem {

    private String category;

    private String url;

    private String details;

    private String title;

    public FeedItem() {

    }

    public String getCategory() {
        return this.category;
    }

    public void setCategory(String argCategory) {
        this.category = argCategory;
    }

    public String getDetails() {
        return this.details;
    }

    public void setDetails(String argDetails) {
        this.details = argDetails;
    }

    public String getUrl() {
        return this.url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getTitle() {
        return this.title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int hashCode() {
        final int PRIME = 31;
        int result = 1;
        result = PRIME * result
                + ((this.category == null) ? 0 : this.category.hashCode());
        result = PRIME * result
                + ((this.details == null) ? 0 : this.details.hashCode());
        result = PRIME * result
                + ((this.title == null) ? 0 : this.title.hashCode());
        result = PRIME * result
                + ((this.url == null) ? 0 : this.url.hashCode());
        return result;
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final FeedItem other = (FeedItem) obj;
        if (this.category == null) {
            if (other.category != null) {
                return false;
            }
        } else if (!this.category.equals(other.category)) {
            return false;
        }
        if (this.details == null) {
            if (other.details != null) {
                return false;
            }
        } else if (!this.details.equals(other.details)) {
            return false;
        }
        if (this.title == null) {
            if (other.title != null) {
                return false;
            }
        } else if (!this.title.equals(other.title)) {
            return false;
        }
        if (this.url == null) {
            if (other.url != null) {
                return false;
            }
        } else if (!this.url.equals(other.url)) {
            return false;
        }
        return true;
    }

    /**
     * Constructs a <code>String</code> with all attributes in name = value
     * format.
     * 
     * @return a <code>String</code> representation of this object.
     */
    public String toString() {
        final String TAB = "    ";

        String retValue = "";

        retValue = "FeedItem ( " + super.toString() + TAB + "category = "
                + this.category + TAB + "url = " + this.url + TAB
                + "details = " + this.details + TAB + "title = " + this.title
                + TAB + " )";

        return retValue;
    }
}
